#include<iostream>
using namespace std;

class Solution {
public:
    int lengthOfLongestSubstring(string s) { // 滑动窗口
        int hash[128] = {0};// 模拟哈希
        int left, right, n = s.size(), ret = 0;
        left = right = 0;
        for (; right < n; right++)
        {
            hash[s[right]]++;
            while (hash[s[right]] > 1)
                hash[s[left++]]--;
            ret = max(ret, right - left + 1);
        }
        return ret;
    }
};

int main()
{

	return 0;
}
